<template>
  <div>
    <el-form :model="form" :rules="rules" ref="registerinfo" label-width="80px" class="register-box">
      <h3 class="register-title ">注册信息</h3>
      <el-form-item label="用户名" prop="name">
        <el-input v-model="form.name" placeholder="请输入用户名"></el-input>
      </el-form-item>
      <el-form-item label="密码" prop="passwd">
        <el-input type="password" v-model="form.passwd" placeholder="请输入密码"></el-input>
      </el-form-item>
      <el-form-item label="性别" prop="sex">
        <el-input v-model="form.sex" placeholder="请输入性别"></el-input>
      </el-form-item>
      <el-form-item label="住址" prop="address">
        <el-input v-model="form.address" placeholder="请输入住址"></el-input>
      </el-form-item>
      <el-form-item label="手机号" prop="iphone">
        <el-input v-model="form.iphone" placeholder="请输入手机号"></el-input>
      </el-form-item>
      <el-form-item label="出生日期" prop="birthday">
        <el-input v-model="form.birthday" placeholder="请输入出生日期(yyyyMMdd)"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" @click="onSubmit('updateInfo')">维护</el-button>
      </el-form-item>
    </el-form>
  </div>
  <!--  <div>
      {{this.$route.params.userName}}
      {{this.$route.params.userId}}
    </div>-->
</template>


<script>
import {updateInfo} from "../api/api";

export default {
  name: "updateInfo",
  data() {
    return {
      form: {
        name: '',
        passwd: '',
        sex:'',
        address:'',
        iphone:'',
        birthday:''
      },
      rules: {
        name: [
          {required: true, message: '用户名不能为空', trigger: 'blur'}
        ],
        passwd: [
          {required: true, message: '密码不能为空', trigger: 'blur'}
        ],
        sex: [
          {required: true, message: '性别不能为空', trigger: 'blur'}
        ],
        address: [
          {required: true, message: '地址不能为空', trigger: 'blur'}
        ],
        iphone: [
          {required: true, message: '手机号不能为空', trigger: 'blur'}
        ],
        birthday: [
          {required: true, message: '出生日期不能为空', trigger: 'blur'}
        ]
      }
    }
  },
  methods:{
    getUserInfo(){
      console.log("123")
    }
  },
  mounted() {
    this.getUserInfo();
  }
}
</script>

<style scoped>
  .register-box {
    /*宽度*/
    width: 400px;
    /*边距*/
    margin: 50px auto;
    /*边框*/
    border: 1px solid #2c3e50;
    /*内边距*/
    padding: 40px;
    /*边框圆角*/
    border-radius: 10px;
    /*阴影*/
    box-shadow: 0 0 30px #2c3e50;
  }

  .register-box {
  text-align: center;
  }
</style>
